package datatime;

import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;

public class CalendarTest4 {

    public static void main(String[] args) {

        //获得 默认的地区 ( 用一个 Locale 对象表示 )
        Locale defaultLocale = Locale.getDefault();
        System.out.println( defaultLocale );

        Locale first = new Locale("zh","CN");
        System.out.println( first );
        Locale second = new Locale("zh","TW");
        System.out.println( second );

        Locale third = new Locale("en" , "US");
        System.out.println( third );

        System.out.println("----------------------------------------");

        //获得 默认的时区( 用一个 TimeZone 对象表示)
        TimeZone defaultTiomeZone = TimeZone.getDefault();//类方法
        System.out.println( defaultTiomeZone );

        String id = "Asia/Chongqing";
        TimeZone tz = TimeZone.getTimeZone( id );
        System.out.println( tz );

        System.out.println("----------------------------------------");

        /*
		String[] ids = TimeZone.getAvailableIDs();
		for( int i = 0 ; i < ids.length ; i++ ) {
			System.out.println( ids[ i ] );
		}
		*/

        Calendar calendar = Calendar.getInstance( tz , first );
        System.out.println( calendar );

        System.out.println( calendar.getTime() );


    }
}
